UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yI7MLTjsWvKrOyNQE5B70XlITPNhZxJuJiHhBfNhm4A='
WHERE
key_id = '34d81f32417b6c39f27d9e273de313fc86ca5f97831bb7dd43effcf1f3caf2ac'
AND (
token = 'yI7MLTjsWvKrOyNQE5B70XlITPNhZxJuJiHhBfNhm4A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)