UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0s+0S/ygpwaHgu69twae6EN2H3/U9d22PICy/m/PeZE='
WHERE
key_id = '98f0e9f974b9fdbe198418527511b81df53c319f98791719a65a5667e56d2dfe'
AND (
token = '0s+0S/ygpwaHgu69twae6EN2H3/U9d22PICy/m/PeZE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)