UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I1QtC2Ne2fzU1O6qv7iG/acCIwZ1E9jQyQd/Q7W/uwQ='
WHERE
key_id = 'e40cbc6f8d2fd8c8e11e95ede0b4573b5a177759846066d090102d81f2bbe86d'
AND (
token = 'I1QtC2Ne2fzU1O6qv7iG/acCIwZ1E9jQyQd/Q7W/uwQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)