UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z/Y1SQlThpLV79Y7glOEF/vClIqhYHHL7BLdMXdUMAg='
WHERE
key_id = 'e99dd360d1a09ee34d1aa0ed999e6a2a5d2d2a9022556f149cad3ba5c85305b2'
AND (
token = 'z/Y1SQlThpLV79Y7glOEF/vClIqhYHHL7BLdMXdUMAg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)