UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x0iKuInnbF1kCz2OWgWWOdgJUmT5AdfHBq5h1C5SKEQ='
WHERE
key_id = '7b2299ea04a7ecdbda51bb9514bf4455992510a1dfe16a1d8886f894d7e69277'
AND (
token = 'x0iKuInnbF1kCz2OWgWWOdgJUmT5AdfHBq5h1C5SKEQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)