UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'twB3E7/ruNPcnI1SQYl6Ge7BE64PR5lO8oY1umTdXFc='
WHERE
key_id = 'd485fc993f0eafe6a4d04dd05f65e7336fcb38ccd0c18d03b032d8578eca11e1'
AND (
token = 'twB3E7/ruNPcnI1SQYl6Ge7BE64PR5lO8oY1umTdXFc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)