UPDATE
cscart_aprillock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v6FCgCrP75ReoZ7e/f8IstZx5yuiAYBp5e95nWr3q78='
WHERE
key_id = 'b01c0d4d97e5c68ac203d3b4a74d9f9ea43807f8fc2ffbd58b19402cdb0de5ef'
AND (
token = 'v6FCgCrP75ReoZ7e/f8IstZx5yuiAYBp5e95nWr3q78='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)