UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lrFsWutQDGIVtc5Ltn1LyZxv86VgVuFxpYU2uaGkw7E='
WHERE
key_id = '9b9ee1fa8e3d782ac21bcdd0822b9da6d1d3ff8882670d3151eda8325e4f99b2'
AND (
token = 'lrFsWutQDGIVtc5Ltn1LyZxv86VgVuFxpYU2uaGkw7E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)