UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JOB6pcJXxl4M/vOjt53l5zwa2LcTHNazEfz4+XbQ72A='
WHERE
key_id = 'a10d986370c0426e92877a88890f357a04dcaae61d6a6bf1c4833b05e0bf2ef7'
AND (
token = 'JOB6pcJXxl4M/vOjt53l5zwa2LcTHNazEfz4+XbQ72A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)