UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7rCMWCIGwjhuvXQxmY/irE4hC9xd2mbiyBdrp9aG7sQ='
WHERE
key_id = '22ef5bb0341c40499a84e0498991c10b816a7bb5f693a7ce680d39dfb7ad065b'
AND (
token = '7rCMWCIGwjhuvXQxmY/irE4hC9xd2mbiyBdrp9aG7sQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)