UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vslSTHvZYCsi4IMyQPXFDr2IAGhJ46JhdKLhtPa+oM4='
WHERE
key_id = '99782c7fa1534274b1fbf784bb89aa0d92538936b8beceea11eb530742dc81c5'
AND (
token = 'vslSTHvZYCsi4IMyQPXFDr2IAGhJ46JhdKLhtPa+oM4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)