UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Va9JMQr9PzdCWCErk5uR8KyPiJEg3YgmBxvqpBYAfOg='
WHERE
key_id = 'f6ab79da42ab773884db97feaca8d6f7c62dfc1adec206b872ad44694254b787'
AND (
token = 'Va9JMQr9PzdCWCErk5uR8KyPiJEg3YgmBxvqpBYAfOg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)