UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RDRgq9/SqrDVUwrlb00iGyDMO/DPiko+zExvZKrktts='
WHERE
key_id = 'fa200291b16a205311f451a8f1c5ec9864ddecdd1156c2d6795b8af9509a61f6'
AND (
token = 'RDRgq9/SqrDVUwrlb00iGyDMO/DPiko+zExvZKrktts='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)