UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QJA57IHYq/n0M1BzDjjqhxi5NuiKs/0A8w7Jqvmg4dM='
WHERE
key_id = '7309337a6332abb3ab3719a4762c1e5bb721794b4c61157f66bfdd94dfd79bd7'
AND (
token = 'QJA57IHYq/n0M1BzDjjqhxi5NuiKs/0A8w7Jqvmg4dM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)