UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mPEqa4k5s9ZzjPLV5W+92tWuie5M8aWQ7lLQjrYR3CQ='
WHERE
key_id = 'beb032c0a60e419fe76dd8cedd1fd7ec128ff82ea97fcf228101ff374ff24a28'
AND (
token = 'mPEqa4k5s9ZzjPLV5W+92tWuie5M8aWQ7lLQjrYR3CQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)