UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V2a/ffcmy1etZO66QakNHrfEl+gLS/fv9sVzddIlkGY='
WHERE
key_id = '7e0c7859c2ab2bf185061ed20964127a75612cc4f77277f9d9881da7e09a7b1d'
AND (
token = 'V2a/ffcmy1etZO66QakNHrfEl+gLS/fv9sVzddIlkGY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)