UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M59YRLAkBN56CC/q9cTZLP3wk6xKKU/HXWICAux3Kkc='
WHERE
key_id = '5fb2bc630350bcc350a6f9d0ca6ee6ab96d627c1b8584cfb0e2b33fedca09007'
AND (
token = 'M59YRLAkBN56CC/q9cTZLP3wk6xKKU/HXWICAux3Kkc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)