UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bw2AT6EahJl5V3B+yS45MbQOIQLzuOA8FfzOdd5n3E8='
WHERE
key_id = '2eb6244a4394cfdc9cfe8ad7fbc4935a8afbc978fcf8102a1c12d8631083b4ec'
AND (
token = 'bw2AT6EahJl5V3B+yS45MbQOIQLzuOA8FfzOdd5n3E8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)