UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bhvdQHbuxIVESLInz/pe+e9m/59ZVzZFKWjLJ7AZQ6I='
WHERE
key_id = 'aae7a409f90d93d271c6a3980711a585aecfc78e876e9184ae8713b786b98eee'
AND (
token = 'bhvdQHbuxIVESLInz/pe+e9m/59ZVzZFKWjLJ7AZQ6I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)