UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eYuyd4rjP/QqK8FANnt9spIBsjreh+uUT/5yHPRMmr4='
WHERE
key_id = 'eb740c0052fbf822d01095e7f6dd21e9169dd2e2b6d76e7c21a657a04ebe3a54'
AND (
token = 'eYuyd4rjP/QqK8FANnt9spIBsjreh+uUT/5yHPRMmr4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)