UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TFepHdWT5UtKeDuVuxTWCjw3UF5s5kF211cLzXpJUmc='
WHERE
key_id = '7535af0b6d0770a0287729992cd09be2abf0316a588c99de16a37cc6a22fffc5'
AND (
token = 'TFepHdWT5UtKeDuVuxTWCjw3UF5s5kF211cLzXpJUmc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)