UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Dac4O/FWzxdQjktD9Xh3XnbQnoYLKc1XXboP8hFwStM='
WHERE
key_id = 'c3a5d5b6c69fca8c78ca6932ae8f0e8a06f611ad755eaec0d58d0a888af48c68'
AND (
token = 'Dac4O/FWzxdQjktD9Xh3XnbQnoYLKc1XXboP8hFwStM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)