UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0VJD44zpSfAI7f6+0YZrRDZqZilVieqDp3riEG0IE18='
WHERE
key_id = '82fc8c20ab976419af1b3745d5869ad4101776ba1469edd25b9e0f09e861fa22'
AND (
token = '0VJD44zpSfAI7f6+0YZrRDZqZilVieqDp3riEG0IE18='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)