UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YbU+UYsRM8Q9w1NR/MBH6L/r26hCb9m24XT10z6KDu4='
WHERE
key_id = 'afd0ba74b0135fe13610462955002099a17a79d60cead3f6542cdc723247e421'
AND (
token = 'YbU+UYsRM8Q9w1NR/MBH6L/r26hCb9m24XT10z6KDu4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)