UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WLtt7atEURIeIwQ45SjjYUph1mEc+JFUBOHNMlPXFaM='
WHERE
key_id = 'c7a80903c50515fa9ce483f93746c2aaf6abc8405121f746b8f6991a71ca46e2'
AND (
token = 'WLtt7atEURIeIwQ45SjjYUph1mEc+JFUBOHNMlPXFaM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)