UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wcNajhjHGQFf0WIDasvG2GOHIi/GMtuW1vaHgdw1jOw='
WHERE
key_id = '40af3f537822466bb61dc9d5b847e3cdf246e930935e867983bc4b074f2f4124'
AND (
token = 'wcNajhjHGQFf0WIDasvG2GOHIi/GMtuW1vaHgdw1jOw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)