UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hftGevRIZ6RbJm1o8OL9lvqbP4Ig19NVU/q9/rB2kUw='
WHERE
key_id = 'd532046dc54027c3a58406e7d77dd795dbd198e5090f80a8d7f30587045a96d7'
AND (
token = 'hftGevRIZ6RbJm1o8OL9lvqbP4Ig19NVU/q9/rB2kUw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)