UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I/2G4FK7aBd1i1wrDTa9N6C8B6d/uYoHe5symgEjo1Y=' 
WHERE 
  key_id = '75ddd8c63a853d340da17fb88e55439f54cb6b658c8e6a378408e82d6af72d3d' 
  AND (
    token = 'I/2G4FK7aBd1i1wrDTa9N6C8B6d/uYoHe5symgEjo1Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019