UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tILb6RkAnb1o+eu/QAi9mrDqvPhRfqfqKcy0yztNcIs='
WHERE
key_id = '93b535ad8eb854471d1ed3c7096bd7328acc9112d6035747a5c3f30a09f9f823'
AND (
token = 'tILb6RkAnb1o+eu/QAi9mrDqvPhRfqfqKcy0yztNcIs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)