UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pIlQ94/8qop3rUEE1EQ2eV3Sz81WGPLnXkcbjIp0N9E=' 
WHERE 
  key_id = '74b714808a0ec2708b46d82c6ec481bfc6246d177d7eb74c51b031d4ec26d6f2' 
  AND (
    token = 'pIlQ94/8qop3rUEE1EQ2eV3Sz81WGPLnXkcbjIp0N9E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015