UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EfmQdKONmUUG4UyuBEUrlt9tGL0LJY8JtFqXksMxc5U='
WHERE
key_id = '13aac80bc17504a5bc9a3599dc8bf4c9141020d973778ff342e6079a6c41fcf6'
AND (
token = 'EfmQdKONmUUG4UyuBEUrlt9tGL0LJY8JtFqXksMxc5U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)